package com.biostime.rpc.terminal.util;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.validation.Validator;
import java.util.Set;

/**
* <p>
* 说明
* </p>
*
* @author yangrzh 2014/8/11
*/
@Component
public class ValidatorUtils {

    @Autowired
    private Validator validator;

    public boolean vali(Object o) {
        Set set = validator.validate(o);
        if (set.size() > 0) {
            return false;
        } else {
            return true;
        }
    }

}
